package stopthread;

/**
 * @description:
 * @author: jhy
 * @time: 2021/4/11 22:33
 */

//interrupted()方法具有执行后清除状态标志位位false的作用
public class InterruptedDemo2 {

    public static void main(String[] args) {
        //中断main线程
        Thread.currentThread().interrupt();
        System.out.println(Thread.interrupted());//true
        System.out.println(Thread.interrupted());//false
        System.out.println(Thread.interrupted());//false
    }
}
